package com.example.medicine.View;
import com.example.medicine.Bean.Team;
import com.example.medicine.Mapper.TeamMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class TeamView {
    @Autowired
    private TeamMapper teamMapper;
    @RequestMapping("/team/create")
    public String teamCreateShow(){
        return "pages/Team/create";
    }
    /**
     * Team编辑展示页面
     */
    @GetMapping("/team/edit/{id}")
    public String getTeamById(@PathVariable String id, Model model){
        Team team =teamMapper.getById(id);
        team.setId(id);
        model.addAttribute("team", team);
        return "pages/Team/edit";
    }
}
